package com.grgbanking.it.base;

import com.grgbanking.it.wx.common.creator.WXBaseMessageCreator;
import com.grgbanking.it.wx.entity.WXPassiveMessage;
import com.grgbanking.it.wx.entity.WXVerify;
/**
 * 微信信息接口
 * 
 * WXConnectionService
 * 
 * @author 潘广伟
 * @Email p_3er@qq.com
 * @Date 2015-1-7 下午5:39:23
 * 
 * @version 1.0.0
 *
 */
public class WXConnectionService implements IWXConnectionService{
	private WXBaseMessageCreator messageCreator;
	
	public void setMessageCreator(WXBaseMessageCreator messageCreator) {
		this.messageCreator = messageCreator;
	}
	
	/**
	 * 获取回调校验的值
	 * verify
	 * 
	 * @param verify
	 * @throws Exception 
	 * @exception 
	 * @since  1.0.0
	 */
	@Override
	public String getEcho(WXVerify verify) throws Exception {
		return messageCreator.getEcho(verify);
	}
	/**
	 * 接收微信过来的信息
	 * reciveMsg
	 * 
	 * @param verify
	 * @return
	 * @throws Exception 
	 * @exception 
	 * @since  1.0.0
	 */
	public WXPassiveMessage reciveMsg(WXVerify verify)throws Exception {
		return messageCreator.reciveMessage(verify);
	}
}
